<?php

/**
 * 电话号码验证
 * @param $num
 * @return unknown_type
 */
function validatePhoneNum($num)
{
     $patrn= "/^((0\d{2,3})-)(\d{7,8})(-(\d{3,}))?$/";
	 $regy = "/^1(3[4-9]|5[012789]|8[78])\d{8}$/";
	 $regl = "/^((130|131|132|155|156|186)+\d{8})$/";
	 $regd = "/^((133|153|189)+\d{8})$/";
	 
    if (preg_match($patrn,$num)||preg_match($regy,$num)||preg_match($regl,$num)||preg_match($regd,$num))
    {
	    return true;
    }
    else
    {
    	return false;
    }
}

function isEmail($email)
{
	$regex = "/^[a-zA-Z0-9]+([\._-][a-zA-Z0-9]+)*@(([a-zA-Z0-9]+([\.-][a-zA-Z0-9]+)?)+\.)+[a-zA-Z]+$/";
	return preg_match($regex,$email);
}